package com.njwd.rpc.consumer;

import java.math.BigDecimal;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.njwd.rpc.api.UserService;
import com.njwd.rpc.vo.User;

public class DubboOuterInner {

	
	
	public static void main(String[] args) {
		System.setProperty("dubbo.application.logger","slf4j");
		ClassPathXmlApplicationContext  ctx= new ClassPathXmlApplicationContext(  
	            new String[] {"spring/applicationContext.xml"});  
		ctx.start();
		//---queryUser  查询建议用Get请求----
		UserService us=(UserService)	ctx.getBean("userServicesOuter");
		System.out.println("------------start:-queryuser--------------");
		System.out.println(us.queryUserByClassId("10"));
		System.out.println("------------end:-queryuser--------------");
		
		
		System.out.println("------------start:-registerUser--------------");
		System.out.println(us.registerUser(new User(new BigDecimal(100),"123" ,"23434")));
		System.out.println("------------end:-registerUser--------------");
		
		
		
		System.out.println("------------start:-queryUserMultiParam--------------");
		System.out.println(us.queryUserMultiParam("123"	,10l));
		System.out.println("------------end:-queryUserMultiParam--------------");
	}
}
